<template>
  <div id="app" v-if="!(path ==='/login')">
    <el-col :span="4">
      <navMenu></navMenu>
    </el-col>
    <el-col :span="20">
      <div class="hearder">
        <div class="header-user">
          <em class="el-icon-user-solid"></em>管理员
        </div>
        <div class="header-logout" @click="logout()">
          <em class="el-icon-right"></em>退出
        </div>
      </div>
      <router-view />
    </el-col>
  </div>
  <div id="app" v-else>
    <router-view />
  </div>
</template>

<script>
import navMenu from "./components/navMenu.vue";
export default {
  name: "App",
  data() {
    return {
      path: "",
    };
  },
  components: {
    navMenu: navMenu,
  },
  watch: {
    $route(to, from) {
      this.path = to.path;
    },
  },
  methods: {
    logout() {
      let vm = this;
      vm.$router.push({ path: "/login" });
    },
  },
};
</script>

<style>
body {
  -moz-user-select: none;
  -khtml-user-select: none;
  user-select: none;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  overflow-y: hidden;
  -moz-user-select: none;
  -khtml-user-select: none;
  user-select: none;
}

#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
  background: #f2f2f2;
}

p {
  margin: 0;
  padding: 0;
}

ul {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

.nav-tit {
  font-size: 16px;
  text-align: center;
  padding: 20px;
}

.main {
  padding: 0 20px;
}
.hearder {
  text-align: right;
  padding: 0 20px;
  height: 60px;
  line-height: 60px;
  font-size: 16px;
  display: flex;
  justify-content: flex-end;
}
.header-user,.header-logout {
   cursor: pointer;
   margin-right: 20px;
}
</style>
